package com.example.demo.service.impl;

import com.example.demo.dao.PlanDao;
import com.example.demo.entity.Plan;
import com.example.demo.service.PlanService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PlanServiceImpl implements PlanService {
    @Resource
    private PlanDao planDao;

    @Override
    public List<Plan> getAllPlanByDesId(String desId) {
        return planDao.getAllPlanByDesId(desId);
    }

    @Override
    public Plan getPlanById(Integer planId) {
        return planDao.getPlanById(planId);
    }

    @Override
    public Integer modifyPlanById(Plan plan) {
        plan.setStatus(0);
        return planDao.modifyPlanById(plan);
    }

    @Override
    public Integer addPlan(Plan plan) {
        plan.setStatus(0);
        return planDao.addPlan(plan);
    }

    @Override
    public Plan getPlanByConCode(String conCode) {
        return planDao.getPlanByConCode(conCode);
    }

    @Override
    public List<Plan> getPlan(String keyword,String desId) {
        return planDao.getPlan(keyword,desId);
    }

    @Override
    public Integer count(String desId) {
        return planDao.count(desId);
    }
}
